package com.supermap.dataservice.rsm.controller;

import com.supermap.dataservice.rsm.service.RsmGridDataService;
import com.supermap.dataservice.util.JSONUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author xiaolu
 * @date 2018/9/5 上午11:35
 */
@RestController
@RequestMapping("grid")
public class RsmGridServiceController {

    @Autowired
    RsmGridDataService gridDataService;

    @RequestMapping("/getRsmDataByLocation/lon={lon}&lat={lat}&date={date}&deep={deep}&valid={valid}&adminCode={adminCode}")
    public JSONUtil getRsmDataByLocation(@PathVariable double lon,
                                    @PathVariable double lat,
                                    @PathVariable String date,
                                    @PathVariable int deep,
                                    @PathVariable int valid,
                                    @PathVariable int adminCode) {
        return gridDataService.getRsmDataByLocation(lon, lat, date, deep, valid, adminCode);
    }
}
